<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>

<body>
    
    <div id="app">

        <input type="button" value="get请求" class="get" @click="getJokes">
        <input type="button" value="post请求" class="post" @click="postJokes">

    </div>

    <script>

        var app = new Vue({
            el: "#app",
            data: {},
            methods: {
                getJokes: async function() {
                    let jokesinfo = await axios.get("https://autumnfish.cn/api/joke/list?num=3");
                    let jokes = jokesinfo.data.jokes;
                    let msg = jokesinfo.data.msg;
                    console.log(msg);
                    for(let i=0;i<jokes.length;i++) console.log(jokes[i]);
                },
                postJokes: async function() {
                    let jokesinfo = await axios.post("https://autumnfish.cn/api/joke/list?num=3");
                    let jokes = jokesinfo.data.jokes;
                    let msg = jokesinfo.data.msg;
                    console.log(msg);
                    for(let i=0;i<jokes.length;i++) console.log(jokes[i]);
                }
            }
        }) 

    </script>

</body>
</html>